<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>上传图片</title>
		<%@ include file="/WEB-INF/views/include/head.jsp"%>
		<script type="text/javascript" src="${ctxStatic }/jquery-form/jquery.form.js"></script>
		<script type="text/javascript">
		$(function() {
			$("#hy_id").val("${hy_id}");			
			$("#id").val("${id}");
	
			$("#upform").submit(function() {
				
					var options = {
						beforeSubmit: showRequest,
						success : function(data) {
							if (data.flag == '1') {														
								window.close();
							} else {
								$("#responseText").text(data.message);
							}
						}
					};
					$(this).ajaxSubmit(options);
						return false;
				});
	
			})
			
		function showRequest(formData, jqForm, options){
			 var form = jqForm[0];
			 form.params.value='{hy_id:'+form.hy_id.value+', id:'+form.id.value+', hkbz:"'+form.hkbz.value+'"}';
			 return true;
		}
		</script>
		<style type="text/css">
		body {
			font-size: 14px;
		}
		
		input {
			vertical-align: middle;
			margin: 0;
			padding: 0
		}
		
		.file-box {
			margin: 10px;
			position: relative;
			width: 340px
		}
		
		.txt {
			height: 22px;
			border: 1px solid #cdcdcd;
			width: 180px;
		}
		
		.btn {
			background-color: #FFF;
			border: 1px solid #CDCDCD;
			height: 24px;
			width: 70px;
		}

		.areaiput {
			height: 80px;
			border: 1px solid #cdcdcd;
			width: 255px;
		}		
		.file {
			position: absolute;
			top: 0;
			right: 80px;
			height: 24px;
			filter: alpha(opacity : 0);
			opacity: 0;
			width: 260px
		}
		</style>
	</head>
	<body>
		<br>
		<div class="file-box">
			<form id="upform" action="${svr_url }api/bus!uploadHkpz.action" method="post" enctype="multipart/form-data">
				<input type="hidden" id="hy_id" name="hy_id" value="" />				
				<input type="hidden" id="id" name="id" value="" /> 
				<input type="hidden" id="params" name="params" value="" />
				<input type='text' name='textfield' id='textfield' class='txt' /> 
				<input type='button' class='btn' value='浏览...' /> 
				<input type="file" name="hkpz" class="file" id="hkpz" size="28" onchange="document.getElementById('textfield').value=this.value" />
				<input type="submit" name="submit" class="btn" value="上传" />
				还款备注：<textarea id="hkbz" name="hkbz" class="areaiput"></textarea>
			</form>
		</div>
	
		<div class="jbxx_box">
			<label id="responseText"></label>
		</div>
	</body>
</html>
